﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

// NotReviewedButNeeded
#pragma once

#include "GcmpModel.h"

namespace gcmp
{
    class IGraphicsElementShape;
    class IDocument;
    class IModelView;
    class Coordinate3d;
    class IGraphicsNodeReference;
    class Vector3d;

    /// \brief 标注工具类
    class GCMP_MODEL_EXPORT DimensionUtils
    {
    public:
        /// \brief 创建用于标注的GRep
        ///
        /// \param pDocument 标注所属的文档
        /// \param pModelView 标注所属的视图
        /// \param coordinate 工作平面所在的坐标系
        /// \param firstNodeReference 第一个锚点引用的节点
        /// \param secondNodeReference 第二个锚点引用的节点
        /// \param dimPosition 标注的位置
        /// \param bShowText 是否显示标注文字
        /// \param isShowName 是否显示标注名称
        /// \param fontSize 标注的大小
        /// \param dimensionName 标注显示名称
        /// \param familyScale 族缩放比例
        /// \return 返回创建的用于标注的GRep
        static OwnerPtr<IGraphicsElementShape> CreateGrep(IDocument* pDocument, const IModelView* pModelView, const Coordinate3d& coordinate, const IGraphicsNodeReference& firstNodeReference, const IGraphicsNodeReference& secondNodeReference,
            const Vector3d& dimPosition, bool bShowText = true, bool isShowName = false, double fontSize = 350, const std::wstring& dimensionName = L"", double familyScale = 1);

        /// \brief 创建用于标注的GRep
        ///
        /// \param pDocument 标注所属的文档
        /// \param pModelView 标注所属的视图
        /// \param coordinate 工作平面所在的坐标系
        /// \param firstNodeReference 第一个锚点引用的节点
        /// \param secondNodeReference 第二个锚点引用的节点
        /// \param dimPosition 标注的位置
        /// \param bShowText 是否显示标注文字
        /// \return 返回创建的用于标注的GRep

        GCMP_OBSOLETE_API(2021 / 02 / 01, DimensionUtils::CreateGrep(IDocument*, const IModelView*, const Coordinate3d&, const IGraphicsNodeReference&, const IGraphicsNodeReference&, const Vector3d&, bool, bool, double, const std::wstring&)) static OwnerPtr<IGraphicsElementShape> CreateGrep(IDocument* pDocument,
                const IModelView* pModelView,
                const Coordinate3d& coordinate,
                const IGraphicsNodeReference& firstNodeReference,
                const IGraphicsNodeReference& secondNodeReference,
                const Vector3d& dimPosition,
                bool bShowText = true);

    };
}
